package model

import (
	"encoding/xml"
	"fmt"
)

type WeixinRequestMsg struct {
	XMLName      xml.Name `xml:"xml"`
	ToUserName   string   `xml:"ToUserName"`
	FromUserName string   `xml:"FromUserName"`
	CreateTime   int      `xml:"CreateTime"`
	MsgType      string   `xml:"MsgType"`
	Content      string   `xml:"Content"`
	Event        string   `xml:"Event"`
	MsgId        string   `xml:"MsgId"`
}

type WeixinResponseTextMsg struct {
	XMLName      xml.Name    `xml:"xml"`
	ToUserName   interface{} `xml:"ToUserName"`
	FromUserName interface{} `xml:"FromUserName"`
	CreateTime   int         `xml:"CreateTime"`
	MsgType      interface{} `xml:"MsgType"`
	Content      interface{} `xml:"Content"`
}

type UserInfo struct {
	CurrentStrategiesNum int64
	MaxStrategiesNum     int
	Email                string
}

func (u UserInfo) String() []string {
	return []string{
		fmt.Sprintf("【当前告警策略数：%d】", u.CurrentStrategiesNum),
		fmt.Sprintf("【最多可创建告警策略数：%d】", u.MaxStrategiesNum),
		fmt.Sprintf("【邮箱：%s】", u.Email),
	}
}
